package com.ccloud.gen.engine.config;


import com.ccloud.common.core.utils.ToolUtil;
import lombok.Data;

/**
 * @Version V1.0
 * @Project bigdata-cloud
 * @Title ContextConfig
 * @Description 全局配置
 * @Package com.ccloud.gen.engine.config
 * @Date 2021/7/8 2:57 下午
 * @Copyright: 武汉大数据产业发展有限公司 All rights reserved.
 */
@Data
public class ContextConfig {

    private String templatePrefixPath = "gunsTemplate/advanced";
    private String projectPath = "/Users/scylla/IdeaProjects/generator/gen";//模板输出的项目目录
    private String bizChName;   //业务名称
    private String bizEnName;   //业务英文名称
    private String bizEnBigName;//业务英文名称(大写)
    private String moduleName = "system";  //模块名称
    private String bizPackageName = "api";  //模块名称


    private String proPackage = "com.ccloud";
    private String coreBasePackage = "com.ccloud.common.core";
    private String modelPackageName = "com.ccloud."+bizPackageName+"."+moduleName+".model";        //model的包名
    private String modelMapperPackageName = "com.ccloud."+bizPackageName+"."+moduleName+".mapper";    //model的dao
    private String entityName;              //实体的名称

    private Boolean controllerSwitch = true;    //是否生成控制器代码开关
    private Boolean indexPageSwitch = true;     //主页
    private Boolean addPageSwitch = true;       //添加页面
    private Boolean editPageSwitch = true;      //编辑页面
    private Boolean detailPageSwitch = true;      //编辑页面
    private Boolean jsSwitch = true;            //js
    private Boolean infoJsSwitch = true;        //详情页面js
    private Boolean daoSwitch = true;           //dao
    private Boolean serviceSwitch = true;       //service
    private Boolean entitySwitch = true;        //生成实体的开关
    private Boolean sqlSwitch = true;           //生成sql的开关

    public void init() {
        if (entityName == null) {
            entityName = bizEnBigName;
        }
    }

    public void setBizEnName(String bizEnName) {
        this.bizEnName = bizEnName;
        this.bizEnBigName = ToolUtil.firstLetterToUpper(this.bizEnName);
    }


}
